//
//  OosTagDao.m
//  Oos4ios
//
//  Created by Pablo Gonzalez on 3/17/11.
//  Copyright 2011 11870.com. All rights reserved.
//

#import <oos4ios/DAOs/OosTagDao.h>
#import "OosDao+Internal.h"
#import "../../Atom/Queries/OosTagQuery.h"
#import "../../Parsers/OosTagParser.h"


@implementation OosTagDao

+ (OosTagDao *) daoFromUser:(OosUser *)user
{
	return [[[OosTagDao alloc] initFromUser: user] autorelease];
}

+ (OosTagDao *) daoFromUserSlug:(NSString *)userSlug
{
	return [[[OosTagDao alloc] initFromUserSlug: userSlug] autorelease];
}

- (OosTagDao *) initFromUserSlug:(NSString *)userSlug
{
	self = [self init];
	if (self) {
		self->mUserSlug = [userSlug retain];
	}
	return self;
}

- (OosTagDao *) initFromUser:(OosUser *)user
{
	self = [self initFromUserSlug: [user slug]];
	if (self) {
		self->mUser = [user retain];
	}
	return self;
}

- (OosQuery *) query
{
	OosQuery *query = [OosTagQuery queryFromUserSlug:mUserSlug];
	[query packStore:self.options];
	return query;
}

- (void)initAtomService:(OosAtomService *)atomService
{
    atomService.feedClass = [GDataAtomCategoryGroup class];
}

- (id <IOosCategoryParser>) categoryParser
{
	return [OosTagParser instance];
}

-(void)dealloc
{
    [mUser release];
    [mUserSlug release];
    [super dealloc];
}


@end
